# 基础设定
cmake_minimum_required(VERSION 3.15)
project(rknn_demo C CXX)
set(TARGET_SOC "rk3588")
message(STATUS "Install Path: " ${CMAKE_INSTALL_PREFIX})

# 加载瑞芯微库
add_subdirectory(./luckfox_libs/3rdparty 3rdparty.out)
add_subdirectory(./luckfox_libs/utils utils.out)
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # 动态链接文件放到install/lib

# 制定可执行文件
set(SOURCES ./user/main.cc ./user/fun.cc)
include_directories(./user)
add_executable(${PROJECT_NAME} ${SOURCES})

# 动态链接
target_link_libraries(${PROJECT_NAME}
	imageutils
    fileutils
    ${LIBRKNNRT}
    dl
    pthread #pthread is for Linux
)
target_include_directories(${PROJECT_NAME} PRIVATE
    ${LIBRKNNRT_INCLUDES}
)

# 安装设定
install(TARGETS ${PROJECT_NAME} DESTINATION .)
install(
    FILES 
    /userdata/linaro/Dataset/mvtec/bottle/test/broken_large/000.png
    DESTINATION ./dataset
)